package com.tarena.test.stream.receiver.mq;

import com.tarena.test.stream.pojo.MyMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

@Component
@EnableBinding(StreamInputChannelSource.class)
public class MyConsumer {
    @StreamListener(StreamInputChannelSource.IN_PUT)
    public void consume(MyMessage message){
        System.out.println("接收到消息："+message);
    }
}
